This invention relates to the data processing field. More specifically, this invention relates to Object Oriented Programming environments.
The development of the EDVAC computer system of 1948 is often cited as the beginning of the computer era. Since that time, computer systems have found their way into just about every aspect of the American life style. One reason for this proliferation is the ability of computer systems to perform a variety of tasks in an efficient manner. The mechanisms used by computer systems to perform these tasks are called computer programs.
Like computer systems themselves, the development of computer programs has evolved over the years. The EDVAC system used what was called a xe2x80x9cone addressxe2x80x9d computer programming language. This language allowed for only the most rudimentary computer programs. By the early 1950s, scientists had developed mechanisms which could convert symbolic instructions that were reasonably understandable to humans into a form which could be understood by a computer system. Each computer system was designed to handle a specific group of these instructions. These groups of instructions are called instruction sets.
The next step in the development of computer programs was the notion of computer programming languages. Computer programming languages were even more understandable than symbolic instruction sets. Computer programs are written using a variety of computer programming languages. Once written, a computer program is compiled into instructions that are part of the instruction set of a particular computer system. FORTRAN is usually cited as one of the first languages to allow computer programs to be written independently of a particular instruction set. By the 1960s, improvements in computer programming languages led to computer programs that were so large and complex that it was difficult to manage and control their development and maintenance.
Hence, in the 1970s, focus was directed away from developing new programming languages towards the development of programming methodologies and environments which could better accommodate the increasing complexity and cost of large computer programs. One such methodology is the Object Oriented Programming (OOP) approach. OOP advocates claim that this approach to computer programming can improve the productivity of computer programmers by as much as twenty-five fold. Hence, while it has been some time since the OOP concept was originally developed, it is currently seen as the way of the future.
The two fundamental concepts of OOP are xe2x80x9cencapsulationxe2x80x9d and xe2x80x9creusability.xe2x80x9d Encapsulation means that information and the means for using the information are conceptually packaged into individual entities called xe2x80x9cobjects.xe2x80x9d The objects represent individual operations or groups of operations that can be performed by a computer system. The information contained in an object is called data and the means used to perform a particular operation upon the information is called a method. The idea of reusability is that the objects are made sufficiently generic so that they can be used by the methods of many other objects. Any program or method program that uses an object is said to be a client of that object (i.e., a client program). The client will call or invoke the object while specifying the method that is to be used. This is called method resolution.
Objects are also considered to be members of a particular xe2x80x9cclassxe2x80x9d of objects. When objects are created they may be members of a particular class or they may be considered to be members of a subclass of a particular class. Objects that are created as members of a subclass are said to have xe2x80x9cinheritedxe2x80x9d the characteristics (i.e., the data and methods) of the class to which they are a subclass (i.e., their super class). For example, consider a class of objects called Canine. The class will have data that describes objects of that class (i.e., name, color, number of eyes and legs, etc.) The class will also have methods defined which can be used to work with the data of the class. For example, an object of class Canine could be an object that represented a canine named REX that was black and had two eyes and four legs. A subclass of class Canine, class Dog, could further define class Canine to include data that indicated what type of canine was involved. For example, an object of class Dog could be created that represented a dog named Lassie that was white and brown, had two eyes, four legs, and was of type Collie. Class Canine would also, then, be considered a super class of class Dog. As objects and subclasses are added, a hierarchical tree structure is created. Each class, be it respectively referred to as a subclass or super class, is considered to be at a certain level in the hierarchical structure. In the example, class Dog, as a subclass of class Canine, would be at a level one greater than that of class Canine.
The two most well known environments which utilize these OOP concepts are the xe2x80x9cC++xe2x80x9d environment and the xe2x80x9cSmalltalkxe2x80x9d environment. The C++ environment is merely an extension to the existing xe2x80x9cCxe2x80x9d computer programming language. Hence, it is an extremely inflexible approach to OOP. Whenever data for a particular class of objects requires a change or whenever a method for a particular class of objects is to be added, all of the objects that are members of the changed class and all of the objects that are members of subclasses of the changed class must be recreated and their methods must be recompiled. Further, clients that depend upon objects of the changed class or upon objects which are members of a subclass of the changed class, must also be recompiled. While this may not seem particularly troublesome for the hypothetical Canine-Dog example presented above, it is extremely costly and time consuming for large systems that include many classes and subclasses.
The Smalltalk approach to OOP is an improvement over that of C++ in that it allows for the addition of methods without recompilation. However, this flexibility is not without cost. The designers of the Smalltalk OOP environment sacrificed efficient method resolution for the ability to add a method without recompilation. Moreover, while the Smalltalk approach to OOP does allow for the addition of methods to objects without incurring the expense of recreation and recompilation, the Smalltalk environment shares the C++ shortcomings for changes to object data.
Essentially, then, the OOP environments of today greatly reduce the productivity advantages that were to be realized by the OOP approach.
It is a principle object of this invention to provide an enhanced OOP environment.
It is another object of this invention to provide an enhanced method and apparatus for generating and storing the structures of an enhanced OOP environment.
It is still another object of this invention to provide an enhanced method and apparatus for routing on an object of an enhanced OOP environment.
It is yet another object of this invention to provide an enhanced method and apparatus for creating an enhanced OOP environment.
It is yet another object of this invention to provide an enhanced method and apparatus for creating versions of the classes of an enhanced OOP environment.
It is yet another object of this invention to provide an enhanced method and apparatus for changing the version of an object instance from one version to another.
These and other objects are accomplished by the OOP mechanisms and apparatus disclosed herein.
OOP environments comprise composite data structures and internal mechanisms for manipulating those structures. The structures are used to allow a user to realize the power of OOP. Hence, the layout of these structures, the way in which the structures inter-relate, and the manner in which they are built and used are all critical to the utility of a particular OOP environment. It is no surprise, then, that manufacturers and suppliers of OOP environments are constantly striving to design composite data structures and internal mechanisms which maximize user productivity.
The internal mechanisms and structures that make up the present invention are collectively referred to as the New Object Model (NOM). The composite data structures and organization of the NOM OOP environment provide significant benefits that are not provided by the environments of the prior art. These benefits include: a more efficient method resolution scheme and the ability to add method programs and object instance data to a class definition without the need to recompile the majority of the code base.
The NOM environment comprises three key composite data structures: the object structure, the interface table, and the method table. The object structure, which is similar in nature to existing OOP object structures, contains the data that characterizes the object and location information about the interface table. The object data is further broken down by class-level. Hence, each object contains as many sets of data as its class is deep in the particular hierarchical tree structure. The interface table contains an interface table entry for the class to which the object belongs and entries for each of the object""s super classes (i.e., one entry for each level the class is deep in the particular hierarchical tree structure). Each entry contains a tuple. The tuple comprises location information about the method table for the subject class-level, an offset for the object data associated with that particular class-level, and a class signature. The location information is used to gain access to the method table, while the offset is used to gain access to the instance data stored in the object. The class signature is used as a safety mechanism to ensure that client programs are correctly invoking the function embodied in a particular method of a particular object. Client programs that do not provide a call signature that matches the class signature will not be allowed to invoke the selected method. The method table for a particular class level contains method table entries which themselves contain location information about individual method programs.
When a client program intends to make use of a function embodied in a particular object, it calls the object by specifying the object name and the name of the method program that is to be invoked. Calling an object is also referred to as xe2x80x9crouting onxe2x80x9d the object. When compiled, the NOM call statement comprises four pieces of information: an object ID, a level, a call signature, and a method offset. The object ID is used to locate and access the particular object. Once accomplished, the location information within the object is used to gain access to the interface table. The level is then used to locate the appropriate interface table entry. As stated, the call signature is used to match against the class signature for the class to which the selected method program is associated. If the signatures match, the location information within the subject interface table entry is used to gain access to the appropriate method table. The method offset is then used to access and invoke the correct method program.
If it becomes necessary to add an additional method program to a particular class, the computer programmer need only add another entry to the method table associated with that particular class. No recompilation of objects is required. Further only those client programs that need access to the new method program will require recompilation.
When a computer programmer wishes to add data to a particular class, the NOM environment allows him or her to simply create a new version of the class and reclassify only those objects that require the new data. Objects of older version are reclassified when and if it becomes necessary.
In addition, the NOM environment provides internal mechanisms which support its composite data structures. These include version and object managers and a class definition utility. The version manager is used to create versions of classes such that several versions of the same class can co-exist. The object manager supports the creation of object instances, while the class definition utility supports the definition of new classes.